Interface FormInterface

Summary

Fully Qualified Name: Laminas\Form\FormInterface
Extends: FieldsetInterface

Description

Methods

Name Description Defined By
add() Add an element or fieldset FieldsetInterface
allowObjectBinding() Checks if the object can be set in this fieldset FieldsetInterface
allowValueBinding() Checks if this fieldset can bind data FieldsetInterface
bind() Bind an object to the element FormInterface
bindValues() Bind values to the bound object FieldsetInterface
get() Retrieve a named element or fieldset FieldsetInterface
getAttribute() Retrieve a single element attribute ElementInterface
getAttributes() Retrieve all attributes at once ElementInterface
getData() Retrieve the validated data FormInterface
getElements() Retrieve all attached elements FieldsetInterface
getFieldsets() Retrieve all attached fieldsets FieldsetInterface
getHydrator() Get the hydrator used when binding an object to the element FieldsetInterface
getInputFilter() Retrieve input filter FormInterface
getLabel() Retrieve the label (if any) used for this element ElementInterface
getMessages() Get validation error messages, if any ElementInterface
getName() Retrieve the element name ElementInterface
getObject() Get the object used by the hydrator FieldsetInterface
getOption() return the specified option ElementInterface
getOptions() get the defined options ElementInterface
getValue() Retrieve the element value ElementInterface
has() Does the fieldset have an element/fieldset by the given name? FieldsetInterface
hasAttribute() Return true if a specific attribute is set ElementInterface
isValid() Validate the form FormInterface
populateValues() Recursively populate value attributes of elements FieldsetInterface
prepareElement() Prepare the form element (mostly used for rendering purposes) ElementPrepareAwareInterface
remove() Remove a named element or fieldset FieldsetInterface
setAttribute() Set a single element attribute ElementInterface
setAttributes() Set many attributes at once ElementInterface
setBindOnValidate() Whether or not to bind values to the bound object when validation succeeds FormInterface
setData() Set data to validate and/or populate elements FormInterface
setFormFactory() Compose a form factory into the object FormFactoryAwareInterface
setHydrator() Set the hydrator to use when binding an object to the element FieldsetInterface
setInputFilter() Set input filter FormInterface
setLabel() Set the label (if any) used for this element ElementInterface
setMessages() Set a list of messages to report when validation fails ElementInterface
setName() Set the name of this element ElementInterface
setObject() Set the object used by the hydrator FieldsetInterface
setOption() Set a single option for an element ElementInterface
setOptions() Set options for an element ElementInterface
setPriority() Set/change the priority of an element or fieldset FieldsetInterface
setValidationGroup() Set the validation group (set of values to validate) FormInterface
setValue() Set the value of the element ElementInterface

Method Details

add()

Add an element or fieldset

$flags could contain metadata such as the alias under which to register the element or fieldset, order in which to prioritize it, etc.

Parameter Name Type Description
$elementOrFieldset array|\Traversable|\ElementInterface Typically,
$flags array

Returns: $this

allowObjectBinding()

Checks if the object can be set in this fieldset

Parameter Name Type Description
$object
$object

Returns: bool

allowValueBinding()

Checks if this fieldset can bind data

Returns: bool

bind()

Bind an object to the element

Allows populating the object with validated values.

Parameter Name Type Description
$object object
$flags int

Returns: mixed

bindValues()

Bind values to the bound object

Parameter Name Type Description
$values array

Returns: mixed

get()

Retrieve a named element or fieldset

Parameter Name Type Description
$elementOrFieldset string

Returns: \ElementInterface

getAttribute()

Retrieve a single element attribute

Parameter Name Type Description
$key string

Returns: mixed

getAttributes()

Retrieve all attributes at once

Returns: array|\Traversable

getData()

Retrieve the validated data

By default, retrieves normalized values; pass one of the VALUES_* constants to shape the behavior.

Parameter Name Type Description
$flag int

Returns: array|object

getElements()

Retrieve all attached elements

Storage is an implementation detail of the concrete class.

Returns: array|\Traversable

getFieldsets()

Retrieve all attached fieldsets

Storage is an implementation detail of the concrete class.

Returns: array|\Traversable

getHydrator()

Get the hydrator used when binding an object to the element

Returns: null|\HydratorInterface

getInputFilter()

Retrieve input filter

Returns: \InputFilterInterface

getLabel()

Retrieve the label (if any) used for this element

Returns: string

getMessages()

Get validation error messages, if any

Returns a list of validation failure messages, if any.

Returns: array|\Traversable

getName()

Retrieve the element name

Returns: string

getObject()

Get the object used by the hydrator

Returns: mixed

getOption()

return the specified option

Parameter Name Type Description
$option string

Returns: null|mixed

getOptions()

get the defined options

Returns: array

getValue()

Retrieve the element value

Returns: mixed

has()

Does the fieldset have an element/fieldset by the given name?

Parameter Name Type Description
$elementOrFieldset string

Returns: bool

hasAttribute()

Return true if a specific attribute is set

Parameter Name Type Description
$key string

Returns: bool

isValid()

Validate the form

Typically, will proxy to the composed input filter.

Returns: bool

populateValues()

Recursively populate value attributes of elements

Parameter Name Type Description
$data array|\Traversable

Returns: void

prepareElement()

Prepare the form element (mostly used for rendering purposes)

Parameter Name Type Description
$form \FormInterface

Returns: mixed

remove()

Remove a named element or fieldset

Parameter Name Type Description
$elementOrFieldset string

Returns: $this

setAttribute()

Set a single element attribute

Parameter Name Type Description
$key string
$value mixed

Returns: $this

setAttributes()

Set many attributes at once

Implementation will decide if this will overwrite or merge.

Parameter Name Type Description
$arrayOrTraversable array|\Traversable

Returns: $this

setBindOnValidate()

Whether or not to bind values to the bound object when validation succeeds

Parameter Name Type Description
$bindOnValidateFlag int

Returns: void

setData()

Set data to validate and/or populate elements

Typically, also passes data on to the composed input filter.

Parameter Name Type Description
$data array|\ArrayAccess

Returns: $this

setFormFactory()

Compose a form factory into the object

Parameter Name Type Description
$factory \Factory

Returns:

setHydrator()

Set the hydrator to use when binding an object to the element

Parameter Name Type Description
$hydrator \HydratorInterface

Returns: $this

setInputFilter()

Set input filter

Parameter Name Type Description
$inputFilter \InputFilterInterface

Returns: $this

setLabel()

Set the label (if any) used for this element

Parameter Name Type Description
$label
$label

Returns: $this

setMessages()

Set a list of messages to report when validation fails

Parameter Name Type Description
$messages array|\Traversable

Returns: $this

setName()

Set the name of this element

In most cases, this will proxy to the attributes for storage, but is present to indicate that elements are generally named.

Parameter Name Type Description
$name string

Returns: $this

setObject()

Set the object used by the hydrator

Parameter Name Type Description
$object
$object

Returns: $this

setOption()

Set a single option for an element

Parameter Name Type Description
$key string
$value mixed

Returns: $this

setOptions()

Set options for an element

Parameter Name Type Description
$options array|\Traversable

Returns: $this

setPriority()

Set/change the priority of an element or fieldset

Parameter Name Type Description
$elementOrFieldset string
$priority int

Returns: $this

setValidationGroup()

Set the validation group (set of values to validate)

Typically, proxies to the composed input filter

Returns: $this

setValue()

Set the value of the element

Parameter Name Type Description
$value mixed

Returns: $this

Top